DecoratedCustomViewStyle
Notification style for custom views that are decorated by the system.
Instead of providing a notification that is completely custom, a developer can set this style and still obtain system decorations like the notification header with the expand affordance and actions.
Use setCustomContentView, setCustomBigContentView and setCustomHeadsUpContentView to set the corresponding custom views to display.
To use this style with your Notification, feed it to setStyle like so:
Notification noti = new NotificationCompat.Builder()
.setSmallIcon(R.drawable.ic_stat_player)
.setLargeIcon(albumArtBitmap))
.setCustomContentView(contentView)
.setStyle(new NotificationCompat.DecoratedCustomViewStyle())
.build();
Content copied to clipboard
If you are using this style, consider using the corresponding styles like TextAppearance_Compat_Notification or TextAppearance_Compat_Notification_Title in your custom views in order to get the correct styling on each platform version.
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getTextsFromContentView(@NonNull context: Context, @NonNull notification: Notification): List<CharSequence>
A helper method to get texts from a Notification's custom content view made by either setCustomBigContentView, setCustomContentView or setCustomHeadsUpContentView.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard